/*
Copyright 2007 Julian Asamer

This file is part of Fractalicious.

    Fractalicious is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Fractalicious is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Fractalicious.  If not, see <http://www.gnu.org/licenses/>.
*/

//The shared data, which makes up the fractal.

#import <Foundation/Foundation.h>
#import "Vector.h"
#import <GraphicsServices/GraphicsServices.h>
#import "ColorChooser.h"


@interface DrawingData : NSObject 

{
	@public
	NSMutableArray *lines;
	NSMutableIndexSet *lastRecs;
	
	int actualLength;
	bool dynStroke;
	bool dynColor;
}
+(DrawingData *)sharedInstance;

-(id) init;

@end


@interface Drawable : NSObject
- (void)drawWithContext: (CGContextRef) context transform:(NSAffineTransform *)trans;
@end

@interface DrawableFractal : Drawable 
{
	BOOL dynStroke, dynColor, onlyLast, firstNot;
	float stroke, dynCFactor;
	FRGBColor fgColor, bgColor;
	CGColorRef color;
}
- (void)setFGColor: (FRGBColor) fg dynamic: (BOOL) dyn_color dynamicColorFactor: (float)dyn_c_factor bGColor: (FRGBColor) bg stroke: (float) s dynamic: (BOOL) dyn_stroke onlyLast: (BOOL) only_last firstNot: (BOOL) first_not;
- (void)info;
@end

@interface Drawable_1s1t : DrawableFractal 
{
	@public
	float *data;
	int depth;
}

- (id)initWithPoints:(float*) points depth: (int) d;

- (void)drawWithContext: (CGContextRef) context transform: (NSAffineTransform *)trans;
- (void)info;
@end

@interface Drawable_1sxt : DrawableFractal 
{
	@public
	float **data;
	int *depths;
	int depthsdepth;
	BOOL rel;
}

- (id)initWithPoints:(float**) points depths: (int *)ds depthsdepth: (int)dd;

- (void)drawWithContext: (CGContextRef) context transform: (NSAffineTransform *)trans;
- (void)info;
@end

@interface Placeholder : DrawableFractal

- (id)init;

- (void)drawWithContext: (CGContextRef) context transform: (NSAffineTransform *) trans;
- (void)info;
@end